package com.isunland.managesystem.ui;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import com.isunland.managesystem.entity.LeaseSubList;

/**
 * 开发公司: 北京信普达系统工程有限公司
 * 开发人员: wangyanan
 */

public class LeaseEquipmentUpdateActivity extends SingleFragmentActivity {
  private LeaseSubList mItem;
  private String mainId;

  @Override public void onCreate(Bundle arg0) {
    mItem =
        (LeaseSubList) getIntent().getSerializableExtra(LeaseEquipmentUpdateFragment.EXTRA_DETAIL);
    mainId = getIntent().getStringExtra(LeaseEquipmentUpdateFragment.EXTRA_MAINiD);
    super.onCreate(arg0);
  }

  @Override protected Fragment createFragment() {
    return LeaseEquipmentUpdateFragment.newInstance(mItem, mainId);
  }

  public static void startActivityForResult(android.support.v4.app.Fragment fragment,
      Activity context, LeaseSubList item, String mainId, int requestCode) {
    if (fragment == null || context == null) return;
    Intent intent = new Intent(context, LeaseEquipmentUpdateActivity.class);
    intent.putExtra(LeaseEquipmentUpdateFragment.EXTRA_DETAIL, item);
    intent.putExtra(LeaseEquipmentUpdateFragment.EXTRA_MAINiD, mainId);
    fragment.startActivityForResult(intent, requestCode);
  }
}


